package org.ns.learn.rpc.client;

import org.ns.learn.rpc.codec.RpcResponse;

public class RpcClientResponse extends RpcResponse {

    public RpcClientResponse(RpcClient client, RpcResponse response) {
        this.client = client;
        setRequestId(response.getRequestId());
        setParameterType(response.getParameterType());
        setResult(response.getResult());
        setError(response.getError());
        this.respsonseTime = System.currentTimeMillis();
    }

    private RpcClient client; // 这个客户端被响应

    private long requestTime;

    private long respsonseTime; // 响应时间

    public RpcClient getClient() {
        return client;
    }

    public long getRequestTime() {
        return requestTime;
    }
    // 设置请求时间
    void setRequestTime(long requestTime) {
        this.requestTime = requestTime;
    }

    public long getRespsonseTime() {
        return respsonseTime;
    }

    void setRespsonseTime(long respsonseTime) {
        this.respsonseTime = respsonseTime;
    }
}
